Skip to content

feat(mcp): add admin tools to read/write a self-hosted instance's own private config#8198

Merged
JSONbored merged 1 commit into
mainfrom
feat/mcp-admin-config-tools
Jul 23, 2026
Merged

feat(mcp): add admin tools to read/write a self-hosted instance's own private config#8198
JSONbored merged 1 commit into
mainfrom
feat/mcp-admin-config-tools

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

Adds an opt-in admin MCP tool category — loopover_admin_get_config, loopover_admin_write_config, loopover_admin_list_config_backups — so a self-hosted operator can edit their instance's private .loopover.yml (global default or per-repo override) through an MCP client instead of SSHing in and hand-editing YAML.

Off by default and gated three separate ways:

  • The tools aren't even registered unless LOOPOVER_MCP_ADMIN_ENABLED is set (matches the existing LOOPOVER_REVIEW_SCREENSHOTS/_ENRICHMENT/_OPS "inert when off" convention — invisible in tools/list, not just rejected at call time).
  • Every call additionally requires a separate, higher-privilege LOOPOVER_MCP_ADMIN_TOKEN — distinct from the shared LOOPOVER_MCP_TOKEN — so a leaked ordinary MCP credential can never reach these tools.
  • The config bind mount stays :ro by default in docker-compose.yml; an operator who wants write access flips it to :rw themselves (documented, not silently unlocked by the flag).

loopover_admin_write_config validates against the same schema-aware validator loopover_validate_config already exposes, writes a timestamped backup of any existing file first, and lands the new content atomically (temp file + rename). dryRun: true runs the same validation and reports what would happen without touching disk. The new mcp-admin actor is explicitly excluded from the public dashboard/API settings surface, same as the existing shared mcp actor.

Closes #7721

Test plan

  • npm run typecheck clean
  • npm run test:ci full local gate green (unsharded coverage, parity tests, ui:lint/ui:typecheck/ui:test/ui:build, all drift checks)
  • docker compose config validates the compose changes
  • New unit tests: test/unit/mcp-admin-config-tools.test.ts (registration gating, auth boundary, get/write/dry-run/list-backups across global/repo/effective scopes), plus new coverage in test/unit/private-config.test.ts and test/unit/auth.test.ts

… private config

Adds an opt-in "admin" MCP tool category (loopover_admin_get_config,
loopover_admin_write_config, loopover_admin_list_config_backups) so a
self-hosted operator can edit .loopover.yml through an MCP client instead of
SSHing in and hand-editing YAML. Off by default and gated three ways: the
tools aren't even registered unless LOOPOVER_MCP_ADMIN_ENABLED is set, calls
require a separate LOOPOVER_MCP_ADMIN_TOKEN distinct from the ordinary shared
MCP token, and the config bind mount stays read-only in docker-compose.yml
until an operator flips it to :rw themselves.

Writes validate against the same schema-aware validator loopover_validate_config
already uses, back up any existing file first, and land atomically (temp file +
rename). The new mcp-admin actor is explicitly excluded from the public
dashboard/API settings surface, same as the existing shared mcp actor.

Closes #7721
@JSONbored JSONbored self-assigned this Jul 23, 2026
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
loopover-ui ac55586 Commit Preview URL

Branch Preview URL
Jul 23 2026, 10:58 AM

@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Bundle Report

Changes will increase total bundle size by 8.39kB (0.11%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
loopover-ui 7.39MB 8.39kB (0.11%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: loopover-ui

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/add-scalar-classes-B7sKFe7_.js (New) 2.17MB 2.17MB 100.0% 🚀
assets/tanstack-vendor--Jl_W7qv.js (New) 739.41kB 739.41kB 100.0% 🚀
assets/docs.fumadocs-spike-api-reference-BcpeWPQB.js (New) 442.92kB 442.92kB 100.0% 🚀
assets/AgentScalarChatInterface.vue-CteqQB9M.js (New) 201.71kB 201.71kB 100.0% 🚀
assets/modal-DIvskimx.js (New) 184.38kB 184.38kB 100.0% 🚀
assets/client-BF9S1AE3.js (New) 146.06kB 146.06kB 100.0% 🚀
assets/self-hosting-configuration-DlhYWHji.js (New) 90.27kB 90.27kB 100.0% 🚀
assets/maintainer-panel-DkifROBa.js (New) 78.99kB 78.99kB 100.0% 🚀
assets/ui-vendor-YjqS-5vQ.js (New) 57.04kB 57.04kB 100.0% 🚀
assets/self-hosting-security-Cgb62yHW.js (New) 44.61kB 44.61kB 100.0% 🚀
assets/routes-DoWiqw61.js (New) 34.98kB 34.98kB 100.0% 🚀
assets/owner-panel-KsOjeqCJ.js (New) 27.36kB 27.36kB 100.0% 🚀
assets/app-B7o0U9mO.js (New) 25.7kB 25.7kB 100.0% 🚀
assets/app.runs-CkGPnebN.js (New) 23.56kB 23.56kB 100.0% 🚀
assets/miner-panel-CZOVEnMx.js (New) 20.28kB 20.28kB 100.0% 🚀
assets/api._op-ZvuFGhvg.js (New) 17.57kB 17.57kB 100.0% 🚀
assets/self-hosting-docs-audit-Dbd0Pdz7.js (New) 16.61kB 16.61kB 100.0% 🚀
assets/app.index-Bjc61exH.js (New) 15.62kB 15.62kB 100.0% 🚀
assets/docs._slug-CtxrPHCr.js (New) 15.22kB 15.22kB 100.0% 🚀
assets/playground-panel-sfKJVgw2.js (New) 14.49kB 14.49kB 100.0% 🚀
assets/app.audit-C-EeOKg6.js (New) 10.11kB 10.11kB 100.0% 🚀
assets/app.config-generator-olblKyTN.js (New) 10.09kB 10.09kB 100.0% 🚀
assets/extension-Bt0JNVUJ.js (New) 10.04kB 10.04kB 100.0% 🚀
assets/fairness-CexFWrJI.js (New) 8.34kB 8.34kB 100.0% 🚀
assets/maintainers-OyZ0tGI9.js (New) 8.09kB 8.09kB 100.0% 🚀
assets/miners-xLCHyfiy.js (New) 7.91kB 7.91kB 100.0% 🚀
assets/agents-pBg2WM4D.js (New) 7.8kB 7.8kB 100.0% 🚀
assets/commands-panel-JcVMnDwI.js (New) 6.65kB 6.65kB 100.0% 🚀
assets/maintainer-workflow-BYXEr0j9.js (New) 6.52kB 6.52kB 100.0% 🚀
assets/roadmap-CjRyWh7_.js (New) 6.33kB 6.33kB 100.0% 🚀
assets/digest-panel-BVksMhIK.js (New) 6.18kB 6.18kB 100.0% 🚀
assets/repos._owner._repo.quality-DIfms9yj.js (New) 6.14kB 6.14kB 100.0% 🚀
assets/docs.index-CX3drtNN.js (New) 5.73kB 5.73kB 100.0% 🚀
assets/docs-nav-BEloVMtu.js (New) 5.53kB 5.53kB 100.0% 🚀
assets/api.index-DqKF_zmN.js (New) 4.7kB 4.7kB 100.0% 🚀
assets/docs-DcIO5DOY.js (New) 2.7kB 2.7kB 100.0% 🚀
assets/api-DX2c2tYH.js (New) 2.69kB 2.69kB 100.0% 🚀
assets/docs-page-D37an0JE.js (New) 2.1kB 2.1kB 100.0% 🚀
assets/table-DV5Url5k.js (New) 1.75kB 1.75kB 100.0% 🚀
assets/app.workbench-C5aWrtz1.js (New) 1.58kB 1.58kB 100.0% 🚀
assets/session-BS24IXd5.js (New) 1.45kB 1.45kB 100.0% 🚀
assets/tooltip-Dv30ums5.js (New) 1.45kB 1.45kB 100.0% 🚀
assets/tabs-BGoO3I7v.js (New) 1.39kB 1.39kB 100.0% 🚀
assets/app.repos-L_3tHCaF.js (New) 1.07kB 1.07kB 100.0% 🚀
assets/input-BCjt6wRA.js (New) 796 bytes 796 bytes 100.0% 🚀
assets/file-cog-CAs0uyLn.js (New) 758 bytes 758 bytes 100.0% 🚀
assets/app.maintainer-B4LbCjVt.js (New) 502 bytes 502 bytes 100.0% 🚀
assets/sparkles-BdKDNS82.js (New) 494 bytes 494 bytes 100.0% 🚀
assets/app.owner-CMaFZPmC.js (New) 474 bytes 474 bytes 100.0% 🚀
assets/app.commands-CH5ZgH0E.js (New) 455 bytes 455 bytes 100.0% 🚀
assets/app.playground-DoZzcN_A.js (New) 442 bytes 442 bytes 100.0% 🚀
assets/reveal-B4ztf1wa.js (New) 442 bytes 442 bytes 100.0% 🚀
assets/index-C0KW_9tG.js (New) 438 bytes 438 bytes 100.0% 🚀
assets/app.digest-DYlsAvu8.js (New) 430 bytes 430 bytes 100.0% 🚀
assets/eye-off-BMrkCllu.js (New) 430 bytes 430 bytes 100.0% 🚀
assets/app.miner-CT9QZVaV.js (New) 422 bytes 422 bytes 100.0% 🚀
assets/key-round-BJXV9H8Y.js (New) 355 bytes 355 bytes 100.0% 🚀
assets/bot-CVNdibZ3.js (New) 328 bytes 328 bytes 100.0% 🚀
assets/trash-2-BffsO9j7.js (New) 328 bytes 328 bytes 100.0% 🚀
assets/save-Bpx8YbEA.js (New) 327 bytes 327 bytes 100.0% 🚀
assets/git-pull-request-arrow-CsooOxxt.js (New) 321 bytes 321 bytes 100.0% 🚀
assets/wrench-CCmjepZM.js (New) 303 bytes 303 bytes 100.0% 🚀
assets/list-checks-DCjiGioe.js (New) 279 bytes 279 bytes 100.0% 🚀
assets/shield-Bd-iegtj.js (New) 272 bytes 272 bytes 100.0% 🚀
assets/workflow-CMPQjNmS.js (New) 265 bytes 265 bytes 100.0% 🚀
assets/compass-BxOdmSjh.js (New) 251 bytes 251 bytes 100.0% 🚀
assets/history-2KT6G7XC.js (New) 237 bytes 237 bytes 100.0% 🚀
assets/activity-JM1KbQF2.js (New) 234 bytes 234 bytes 100.0% 🚀
assets/message-square-ojAGGype.js (New) 233 bytes 233 bytes 100.0% 🚀
assets/lock-DdvqtNyc.js (New) 206 bytes 206 bytes 100.0% 🚀
assets/rotate-cw-Du0JBW1E.js (New) 201 bytes 201 bytes 100.0% 🚀
assets/play-Bl1eTJZY.js (New) 190 bytes 190 bytes 100.0% 🚀
assets/circle-check-CjbHf3dM.js (New) 178 bytes 178 bytes 100.0% 🚀
assets/search-DXXqkCyT.js (New) 174 bytes 174 bytes 100.0% 🚀
assets/circle-t2PP6e_j.js (New) 130 bytes 130 bytes 100.0% 🚀
assets/add-scalar-classes-BhI3IvhW.js (Deleted) -2.17MB 0 bytes -100.0% 🗑️
assets/tanstack-vendor-DkoUveDM.js (Deleted) -739.41kB 0 bytes -100.0% 🗑️
assets/docs.fumadocs-spike-api-reference-Dxt1Y9lD.js (Deleted) -442.92kB 0 bytes -100.0% 🗑️
assets/AgentScalarChatInterface.vue-DTAazoyL.js (Deleted) -201.71kB 0 bytes -100.0% 🗑️
assets/modal-Bf_Zpm3T.js (Deleted) -184.38kB 0 bytes -100.0% 🗑️
assets/client-ddSpzg2m.js (Deleted) -146.06kB 0 bytes -100.0% 🗑️
assets/self-hosting-configuration-C9DpQOnR.js (Deleted) -81.92kB 0 bytes -100.0% 🗑️
assets/maintainer-panel-4P_YZwUh.js (Deleted) -78.99kB 0 bytes -100.0% 🗑️
assets/ui-vendor-z3Updml2.js (Deleted) -57.04kB 0 bytes -100.0% 🗑️
assets/self-hosting-security-UjkCSBML.js (Deleted) -44.56kB 0 bytes -100.0% 🗑️
assets/routes-BR4CRaYB.js (Deleted) -34.98kB 0 bytes -100.0% 🗑️
assets/owner-panel-zoJh4hoL.js (Deleted) -27.36kB 0 bytes -100.0% 🗑️
assets/app-CJ3KjKH2.js (Deleted) -25.7kB 0 bytes -100.0% 🗑️
assets/app.runs-BtUfGM_D.js (Deleted) -23.56kB 0 bytes -100.0% 🗑️
assets/miner-panel-NYQZozdd.js (Deleted) -20.28kB 0 bytes -100.0% 🗑️
assets/api._op-BRYi9R6D.js (Deleted) -17.57kB 0 bytes -100.0% 🗑️
assets/self-hosting-docs-audit-OPoeBFlk.js (Deleted) -16.61kB 0 bytes -100.0% 🗑️
assets/app.index-C2ji5Xif.js (Deleted) -15.62kB 0 bytes -100.0% 🗑️
assets/docs._slug-CAaMdFW3.js (Deleted) -15.22kB 0 bytes -100.0% 🗑️
assets/playground-panel-IDepM8TS.js (Deleted) -14.49kB 0 bytes -100.0% 🗑️
assets/app.audit-CuaxN99L.js (Deleted) -10.11kB 0 bytes -100.0% 🗑️
assets/app.config-generator-C8Bl3-d_.js (Deleted) -10.09kB 0 bytes -100.0% 🗑️
assets/extension-BjO9X9NR.js (Deleted) -10.04kB 0 bytes -100.0% 🗑️
assets/fairness-Cwxieb7f.js (Deleted) -8.34kB 0 bytes -100.0% 🗑️
assets/maintainers-CmDQ4jNk.js (Deleted) -8.09kB 0 bytes -100.0% 🗑️
assets/miners-CpzkQbSi.js (Deleted) -7.91kB 0 bytes -100.0% 🗑️
assets/agents-hcezP3XR.js (Deleted) -7.8kB 0 bytes -100.0% 🗑️
assets/commands-panel-Jo1THXis.js (Deleted) -6.65kB 0 bytes -100.0% 🗑️
assets/maintainer-workflow-DD23sLZx.js (Deleted) -6.52kB 0 bytes -100.0% 🗑️
assets/roadmap-B71kAesr.js (Deleted) -6.33kB 0 bytes -100.0% 🗑️
assets/digest-panel-VhYEq89W.js (Deleted) -6.18kB 0 bytes -100.0% 🗑️
assets/repos._owner._repo.quality-B6gpAzAt.js (Deleted) -6.14kB 0 bytes -100.0% 🗑️
assets/docs.index-BeV2GpjD.js (Deleted) -5.73kB 0 bytes -100.0% 🗑️
assets/docs-nav-heAGhHxR.js (Deleted) -5.53kB 0 bytes -100.0% 🗑️
assets/api.index-CiqCPlOu.js (Deleted) -4.7kB 0 bytes -100.0% 🗑️
assets/docs-DVtsa2NP.js (Deleted) -2.7kB 0 bytes -100.0% 🗑️
assets/api-DPNUjGHf.js (Deleted) -2.69kB 0 bytes -100.0% 🗑️
assets/docs-page-BTQxvtqk.js (Deleted) -2.1kB 0 bytes -100.0% 🗑️
assets/table-COi6zBD0.js (Deleted) -1.75kB 0 bytes -100.0% 🗑️
assets/app.workbench-CG5cd3Uh.js (Deleted) -1.58kB 0 bytes -100.0% 🗑️
assets/session-DoKDWDP2.js (Deleted) -1.45kB 0 bytes -100.0% 🗑️
assets/tooltip-CXoKwQU9.js (Deleted) -1.45kB 0 bytes -100.0% 🗑️
assets/tabs-DjauiZEL.js (Deleted) -1.39kB 0 bytes -100.0% 🗑️
assets/app.repos-CL0YfLi3.js (Deleted) -1.07kB 0 bytes -100.0% 🗑️
assets/input-k7g6PPV9.js (Deleted) -796 bytes 0 bytes -100.0% 🗑️
assets/file-cog-JhMEEoFM.js (Deleted) -758 bytes 0 bytes -100.0% 🗑️
assets/app.maintainer-CeTBmcZ_.js (Deleted) -502 bytes 0 bytes -100.0% 🗑️
assets/sparkles-Bahr8PuY.js (Deleted) -494 bytes 0 bytes -100.0% 🗑️
assets/app.owner-BatTQR_7.js (Deleted) -474 bytes 0 bytes -100.0% 🗑️
assets/app.commands-BAW7Cicy.js (Deleted) -455 bytes 0 bytes -100.0% 🗑️
assets/app.playground-U0HkTBiT.js (Deleted) -442 bytes 0 bytes -100.0% 🗑️
assets/reveal-BRL7MSXQ.js (Deleted) -442 bytes 0 bytes -100.0% 🗑️
assets/index-Bbr7ozVK.js (Deleted) -438 bytes 0 bytes -100.0% 🗑️
assets/app.digest-Bke0zaBp.js (Deleted) -430 bytes 0 bytes -100.0% 🗑️
assets/eye-off-DiTKHtqi.js (Deleted) -430 bytes 0 bytes -100.0% 🗑️
assets/app.miner-DR9dCohC.js (Deleted) -422 bytes 0 bytes -100.0% 🗑️
assets/key-round-D8lpBD0H.js (Deleted) -355 bytes 0 bytes -100.0% 🗑️
assets/bot-CtuyDQ2E.js (Deleted) -328 bytes 0 bytes -100.0% 🗑️
assets/trash-2-SDJOxpk2.js (Deleted) -328 bytes 0 bytes -100.0% 🗑️
assets/save-ALrslo9p.js (Deleted) -327 bytes 0 bytes -100.0% 🗑️
assets/git-pull-request-arrow-EpOpiQB9.js (Deleted) -321 bytes 0 bytes -100.0% 🗑️
assets/wrench-yv8GoAJx.js (Deleted) -303 bytes 0 bytes -100.0% 🗑️
assets/list-checks-qGNtZBjj.js (Deleted) -279 bytes 0 bytes -100.0% 🗑️
assets/shield-DkATb6Jc.js (Deleted) -272 bytes 0 bytes -100.0% 🗑️
assets/workflow-B-f2WWvQ.js (Deleted) -265 bytes 0 bytes -100.0% 🗑️
assets/compass-Bea1UrrN.js (Deleted) -251 bytes 0 bytes -100.0% 🗑️
assets/history-FAOhbQA4.js (Deleted) -237 bytes 0 bytes -100.0% 🗑️
assets/activity-Bm01L1bs.js (Deleted) -234 bytes 0 bytes -100.0% 🗑️
assets/message-square-CKeqbxhA.js (Deleted) -233 bytes 0 bytes -100.0% 🗑️
assets/lock-C3JtoRFs.js (Deleted) -206 bytes 0 bytes -100.0% 🗑️
assets/rotate-cw-C3qsPd46.js (Deleted) -201 bytes 0 bytes -100.0% 🗑️
assets/play-CktU5t01.js (Deleted) -190 bytes 0 bytes -100.0% 🗑️
assets/circle-check-CRJjqdQ2.js (Deleted) -178 bytes 0 bytes -100.0% 🗑️
assets/search-83Q37kfG.js (Deleted) -174 bytes 0 bytes -100.0% 🗑️
assets/circle-CVxTi9dh.js (Deleted) -130 bytes 0 bytes -100.0% 🗑️

@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.47887% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.08%. Comparing base (9d021ad) to head (ac55586).
⚠️ Report is 3 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/mcp/server.ts 94.91% 0 Missing and 3 partials ⚠️
src/selfhost/private-config.ts 97.05% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main    #8198    +/-   ##
========================================
  Coverage   92.07%   92.08%            
========================================
  Files         771      772     +1     
  Lines       77942    78082   +140     
  Branches    23545    23595    +50     
========================================
+ Hits        71767    71902   +135     
  Misses       5062     5062            
- Partials     1113     1118     +5     
Flag Coverage Δ
shard-1 57.11% <11.97%> (-1.38%) ⬇️
shard-2 55.51% <49.29%> (+5.75%) ⬆️
shard-3 49.84% <57.04%> (-5.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/api/routes.ts 95.28% <100.00%> (ø)
src/auth/security.ts 99.02% <100.00%> (+<0.01%) ⬆️
src/mcp/private-config-admin-registry.ts 100.00% <100.00%> (ø)
src/services/control-panel-roles.ts 100.00% <ø> (ø)
src/signals/focus-manifest-loader.ts 95.83% <100.00%> (+0.03%) ⬆️
src/selfhost/private-config.ts 98.98% <97.05%> (-1.02%) ⬇️
src/mcp/server.ts 96.64% <94.91%> (-0.10%) ⬇️

@JSONbored
JSONbored merged commit ec3d5e2 into main Jul 23, 2026
17 of 18 checks passed
@JSONbored
JSONbored deleted the feat/mcp-admin-config-tools branch July 23, 2026 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP admin tools: read/write a self-hosted instance's own private .loopover.yml config

1 participant